<?php
header ("Content-Type:text/html; charset= utf-8");
require_once ('config.php');
require_once (WEBURL.'/login_status_check.php');
if(!checkLogin()){
	$gotopage=base64_encode("work_climate_set.php");
	header("Location:admin_login.php?gotopage=".$gotopage);
}
else{
	
	
	if(empty($_POST['type']))
	{
		$filename=WEBURL."/data/default/leadership.txt";
	}
	$filename=WEBURL."/data/default/".$_POST['type'].".txt";
	$default_content=$_POST['default_content'];
	file_put_contents($filename,$default_content);
	echo "<script language=JavaScript> alert('设置成功！');window.location.href='work_climate_set.php?type=".$_POST['type']."';</script>";
		
	
}